#pragma once

/* OpenGL color system */
struct OGL_Color{
	float r, g, b, a; /* red, blue, green, alpha */
};

struct Range
{
	double max, min;
};

struct Dimension {
	int w, h;
};

// I'd use SDL_Rect, but those values are unsigned
struct GameRectangle 
{

	int x, y, width, height;

	int x1, y1, x2, y2; // Re-specifys the GameRectangle

	GameRectangle():x(0), y(0), width(0), height(0),
					x1(0), y1(0), x2(0), y2(0)
	{
		
	}
	GameRectangle(int Xpos, int Ypos, int Width, int Height):x(Xpos), y(Ypos), width(Width), height(Height)
	{
		x1 = x; x2 = x1 + width;
		y1 = y; y2 = y1 + height;
	}

	GameRectangle(const GameRectangle& rect):x(rect.x), y(rect.y), width(rect.width), height(rect.height),
											 x1(rect.x1), y1(rect.y1), x2(rect.x2), y2(rect.y2)
	{}


	void SetX(int xPos) {x = xPos; x1 = xPos; x2 = x1 + width;}
	void SetY(int yPos) {y = yPos; y1 = yPos; y2 = y1 + width;}

	void SetX2(int xPos) {x2 = xPos; width = x1 - x2;}
	void SetY2(int yPos) {y2 = yPos; height = y1 - y2;}

	void SetWidth(int w) {width = w; x2 = x1 + w;}
	void SetHeight(int h) {height = h; y2 = y1 + h;}

};

template<typename T>
struct Rect
{
  Rect()
    : x(0), y(0), w(0), h(0)
  {}

  Rect(T X, T Y, T W, T H)
    : x(X), y(Y), w(W), h(H)
  {}

  T x, y, w, h;
};

typedef Rect<int> Recti;
static Recti InvalidRecti(-1, -1, -1, -1);

static GameRectangle InvalidRect(-1,-1,-1,-1);